<template>
	 
		<el-row  :gutter="5">
			<el-col :span="6">
				<xm-phase ref="xmPhase" :xm-product="xmProduct" @check-change="onPhaseRowClick" @project-select="onProjectRowClick" />
			</el-col> 
			<el-col :span="18">
				<xm-task-mng v-if="selProject && selProject.id" :xm-product="xmProduct" :sel-project="selProject"  :parent-task="parentTask" :params="{ntype:'1'}" queryScope="plan" subOpType="mng"  @batch-add-submit="onBatchAddSubmit"/>
			</el-col>
		</el-row>
	
</template>

<script>
	import util from '@/components/mdp-ui/js/util';//全局公共库 
	import { mapState } from 'pinia'
import { useUserStore } from '@/store/modules/user'	 
import { useXmStore } from '@/store/modules/xm'	 
	
  	import  XmPhase from '@/views/xm/core/xmTask/XmPhase.vue';//新增界面
 	import  XmTaskMng from '@/views/xm/core/xmTask/XmTaskMng.vue';//新增界面
	export default { 
        
		components: {   
			XmPhase,XmTaskMng
		}, 
		computed: {
		    ...mapState(useUserStore,[
		      'userInfo','roles' 
		    ]), 
            
		    ...mapState(useXmStore,[ 'xmProduct' ]), 
			
        }, 
		watch: {  
			 
	    },
		data() {
			return { 
				selProject:null,
				parentTask:null,  

			}//end return
		},//end data
		methods: {  
			 onPhaseRowClick(task,checked){
				if(checked){ 
					this.parentTask=task
				}else{
					this.parentTask=null
				}
			 },
			 onProjectRowClick(selProject){
				this.selProject=selProject
				this.parentTask=null
			 },
			 onBatchAddSubmit(){
				this.$refs.xmPhase.refresh()
			 }
		},//end method
		mounted() {
			 
			
		}//end mounted
	}

</script> 

<style lang="less" scoped> 
 
</style>